exports.main = function() {};

/*
var rq = require("request");

var request = rq.Request({
    url: "http://www.google.com/",
    onComplete: function(){
       console.log(request.response.text);
    }
}).get();
*/
/*
function dump(obj){
    for (var o in obj){ // it spits strings...
        console.log(o," ("+typeof obj[o]+")",//"\n",
                   //"\n\n"+obj[o],"\n",
                    "");
    }
}
*/
var tabs = require("tabs");
var self = require("self");

var fph = self.data.load("fph.js");
//var xph = self.data.load("xph.js");
var jq = self.data.load("jquery-1.3.2.min.js");

function insertJS(document,text){
        var head = document.getElementsByTagName("head")[0];
        var script = document.createElement('script');
        script.type = "text/javascript";
        script.text = text;
        head.appendChild(script);
}

tabs.onReady = function(tab){
        var url = ""+tab.location;
        if (url.indexOf("filelist.ro") != -1 || url.indexOf("flro.org") != -1){
                //dump(tab.contentDocument);
                var document = tab.contentDocument;
                insertJS(document,jq);
                insertJS(document,fph);
                //insertJS(document,xph);
        }
}; 





